package st.business.tepth.business.user.busnumber.workholder.maintain.work.content;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.MaintainNotCompleteBean;
import st.business.tepth.business.bean.MaintainNotWorkWrapper;
import st.business.tepth.business.bean.PickGoods;
import st.business.tepth.business.bean.RepairTaskBean;
import st.business.tepth.business.bean.RepairTaskTypeBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-03-23 09:46
 */

public interface MaintainWorkContract {
    interface View extends BaseView {
        void showRepairTask(RepairTaskBean repairTaskBean);

        void showError(String msg);

        void submitFinishSucceed();

        void showPickGoods(List<PickGoods> list);

        void pickGoodsSucceed();

        void finishSucceed();

        void showNotWorkMaintain(List<MaintainNotWorkWrapper> list);

        void commitNotWorkSucceed();

        void cancelFinishWorkSucceed();
    }

    interface Model extends BaseModel {
        Disposable getWorkData(String token, int repairId, int vehicleSeriesId,
                               OnDataConvertListener<RepairTaskTypeBean> listener);

        Disposable commitProgram(String token, int repairId, int repairTaskId,
                                 int vehicleSeriesId,
                                 String taskItemList,
                                 String maintenanceOperationList,
                                 OnDataConvertListener<List<PickGoods>> pickListener,
                                 OnDataConvertListener<RepairTaskTypeBean> listener);

        Disposable submitFinishWork(String token, int repairId,
                                    int repairTaskId,
                                    int vehicleSeriesId,
                                    OnDataConvertListener<RepairTaskTypeBean>
                                            dataListener,
                                    OnDataConvertListener<MaintainNotCompleteBean>
                                            notCompleteListener,
                                    OnDataConvertListener<String>
                                            statusListener);

        Disposable pickGoods(String token, int repairId,
                             int vehicleSeriesId, String materialApplyList,
                             OnDataConvertListener<String> pickListener,
                             OnDataConvertListener<RepairTaskTypeBean> listener);

        Disposable commitNotWork(String token, int repairId, String workList,
                                 OnDataConvertListener<String> listener);

        Disposable cancelFinishWork(String token, int repairId, int repairTaskId,
                                    int vehicleSeriesId,
                                    OnDataConvertListener<String> cancelListener,
                                    OnDataConvertListener<RepairTaskTypeBean> dataListener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getWorkData(String token, int repairId, int vehicleSeriesId);

        abstract void commitProgram(String token, int repairId, int repairTaskId,
                                    int vehicleSeriesId,
                                    String taskItemList,
                                    String maintenanceOperationList);

        abstract void submitFinishWork(String token, int repairId, int repairTaskId,
                                       int vehicleSeriesId);

        abstract void pickGoods(String token, int repairId,
                                int vehicleSeriesId, String materialApplyList);

        abstract void commitNotWork(String token, int repairId, String workList);

        abstract void cancelFinishWork(String token, int repairId, int repairTaskId,
                                       int vehicleSeriesId);
    }
}
